<h1>Sponsoring</h1>
<?php
if (($top_data->rel_network_to_member->member_image == '') || ($top_data->rel_network_to_member->member_image != '' && !file_exists(Yii::app()->params['config']['updir']['member'] . $top_data->rel_network_to_member->member_image)))
    $member_image = '_default.jpg';
else
    $member_image = $top_data->rel_network_to_member->member_image;
?>
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th colspan="2">Info Sponsor <?php if ($level > 0)
    echo '(Level ' . $level . ' Anda)'; ?></th>
        </tr>
        <tr>
            <td width="100" align="center"><?php echo CHtml::image(Yii::app()->params['config']['dir']['member'] . $member_image, $top_data->rel_network_to_member->member_name, array('width' => 75, 'style' => 'border:1px solid #ccc; padding:3px;')); ?></td>
            <td valign="top">
                <strong><?php echo $top_data->network_mid; ?></strong><br />
                <?php echo $top_data->rel_network_to_member->member_name; ?><br />
                <?php echo function_lib::get_area_name($top_data->rel_network_to_member->member_city_id); ?>, <?php echo function_lib::get_area_name($top_data->rel_network_to_member->member_state_id); ?>
            </td>
        </tr>
    </table>
</div>
<br />
<br />
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th colspan="4" style="text-align:left;">
                <strong>
                    Level 1 dari <?php echo function_lib::get_network_mid($sponsor_id); ?>
                    <?php
                    if ($up_sponsor_id != '0' && $sponsor_id != Yii::app()->user->getState('network_id'))
                        echo ' (<a href="' . Yii::app()->baseUrl . '/member/binary/sponsoring/' . function_lib::get_network_mid($up_sponsor_id) . '">up</a>)';
                    ?>
                </strong>
            </th>
        </tr>
        <tr>
            <th width="10">No</th>
            <th colspan="2">Member</th>
            <th width="100">Sponsor</th>
        </tr>
        <?php
        $no = 1;
        if ($rs_data != null) {
            foreach ($rs_data as $row) {
                if (($row['member_image'] == '') || ($row['member_image'] != '' && !file_exists(Yii::app()->params['config']['updir']['member'] . $row['member_image']))) {
                    $member_image = '_default.jpg';
                } else {
                    $member_image = $row['member_image'];
                }
                $level_status = function_lib::get_one("network_level_status", "sys_network", "network_id = '".$row['network_id']."'")
                ?>
                <tr>
                    <td align="right" valign="top"><?php echo $no; ?>.</td>
                    <td align="center" width="100"><?php echo CHtml::image(Yii::app()->params['config']['dir']['member'] . $member_image, $row['member_name'], array('width' => 75, 'style' => 'border:1px solid #ccc; padding:3px;')); ?></td>
                    <td valign="top"><strong><a href="<?php echo Yii::app()->baseUrl; ?>/member/binary/sponsoring/<?php echo $row['network_mid']; ?>"><?php echo $row['network_mid']; ?></a></strong>&nbsp;(<?php echo ucfirst($level_status); ?>)<br /><?php echo $row['member_name']; ?><br /><?php echo function_lib::get_area_name($row['member_city_id']); ?>, <?php echo function_lib::get_area_name($row['member_state_id']); ?><br \>Tanggal <?php echo function_lib::convert_date($row['member_join_datetime'],$type = '', $format = ' ', $lang = 'ina');?></td>
                    <td align="center" valign="top"><a href="<?php echo Yii::app()->baseUrl; ?>/member/binary/sponsoring/<?php echo function_lib::get_network_mid($row['network_sponsor_network_id']); ?>"><?php echo function_lib::get_network_mid($row['network_sponsor_network_id']); ?></a></td>
                </tr>
        <?php
        $no++;
    }
}
else
    echo '<tr><td colspan="4" align="center">---=====---</td></tr>';
?>
    </table>
</div>